package com.zhiyinlou.api.page.user;

import java.util.HashMap;

import com.alibaba.fastjson.JSONObject;
import com.zhiyinlou.api.util.file.ParsePropertiesUtil;
import com.zhiyinlou.api.util.http.HttpclientUtil;

/**
 * 示例：登录接口
 * @author nore
 * 返回示例：{"code":"200","ticket":"1234"}
 */
public class LoginTest {
	
	
	public static String login(String username,String password,String imgcode) {

		String url = ParsePropertiesUtil.getInstance().getProperty("url_user");
		url = url + "/login";

		HashMap<String, String> requestHeaders = new HashMap<String, String>();
		
		JSONObject jsonObj=new JSONObject();
		jsonObj.put("username", username);
		jsonObj.put("password", password);
		jsonObj.put("imgcode", imgcode);
		

		String response = HttpclientUtil.httpJsonPost(url, requestHeaders, jsonObj);
		return response;
	}

}
